//
//  WJXibTableViewCell.m
//  JerryIos
//
//  Created by jerrywang on 2018/2/3.
//  Copyright © 2018年 王军. All rights reserved.
//

#import "WJXibTableCell.h"
#import "WJShop.h"

@interface WJXibTableCell()
    
@property (weak, nonatomic) IBOutlet UIImageView *iconImage;
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UILabel *descLabel;
@property (weak, nonatomic) IBOutlet UILabel *priceLabel;

@end

@implementation WJXibTableCell

+(instancetype) cellWithTableView:(UITableView *)tableView {
    static NSString *shopCell = @"WJXibTableCell";
    WJXibTableCell *shopViewCell = [tableView dequeueReusableCellWithIdentifier:shopCell];
    if (shopViewCell == nil) {
        shopViewCell = [[[NSBundle mainBundle] loadNibNamed:@"WJXibTableCell" owner:nil options:nil] lastObject];
    }
    return shopViewCell;
}

-(void) setShop:(WJShop *)shop {
    _shop = shop;
    
    self.iconImage.image = [UIImage imageNamed:shop.icon];
    self.titleLabel.text = shop.title;
    self.descLabel.text = shop.desc;
    self.priceLabel.text = shop.price;
}

@end
